package com.liu.qqRobot.wm.enums;

public enum LichElementEnum {

    IMPACT("impact", "冲击"),
    HEAT("heat", "火焰"),
    COLD("cold", "冰冻"),
    ELECTRICITY("electricity", "电击"),
    TOXIN("toxin", "毒素"),
    MAGNETIC("magnetic", "磁力"),
    RADIATION("radiation", "辐射"),
    ;

    private final String type;

    private final String name;

    LichElementEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    /**
     * 通过名称获取赤毒属性
     * @param name name
     * @return String
     */
    public static String getTypeByName(String name) {
        for (LichElementEnum lichElementEnum : LichElementEnum.values()) {
            if (lichElementEnum.getName().equals(name)) {
                return lichElementEnum.getType();
            }
        }
        return null;
    }

    /**
     * 通过赤毒属性获取名称
     * @param type type
     * @return String
     */
    public static String getNameByType(String type) {
        for (LichElementEnum lichElementEnum : LichElementEnum.values()) {
            if (lichElementEnum.getType().equals(type)) {
                return lichElementEnum.getName();
            }
        }
        return null;
    }
}
